Skip to content

Updated the style for GUI to move down when the console is open#201

Closed
micahnyc wants to merge 2 commits intomasterfrom
feature/duck-gui-for-console
Closed

Updated the style for GUI to move down when the console is open#201
micahnyc wants to merge 2 commits intomasterfrom
feature/duck-gui-for-console

Conversation

@micahnyc
Copy link
Copy Markdown
Contributor

@micahnyc micahnyc commented Mar 6, 2026

Previously the gui would stay behind the console when it was open, now it ducks underneath the console the way that the dashboard does.

While I guess it's not ideal that this will still happen if you have the gui open in a browser, it seems like its still nice to have for the main openspace use.

@micahnyc
Copy link
Copy Markdown
Contributor Author

micahnyc commented Mar 6, 2026

Old:
image

New:

image

@alexanderbock alexanderbock changed the title updated the style for gui to move down when the console is open. Updated the style for GUI to move down when the console is open Mar 6, 2026
@engbergandreas
Copy link
Copy Markdown
Member

We should be able to use the window.isWithinCEF to not dropdown on the browser, example here


const consoleOpen = useAppSelector((state) => state.properties.properties[LuaConsoleIsVisibleKey]?.value) as boolean | undefined;
const historyLength = useAppSelector((state) => state.properties.properties[LuaConsoleLengthKey]?.value) as number | undefined;
const consoleTop = historyLength ? historyLength*16 + 36 : 35;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const consoleTop = historyLength ? historyLength*16 + 36 : 35;
const consoleTop = historyLength ? historyLength * 16 + 36 : 35;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't checked but we should double check that this works on multiple resolutions so its not a one type of monitor size that it looks good on

Comment on lines +84 to +85
const consoleOpen = useAppSelector((state) => state.properties.properties[LuaConsoleIsVisibleKey]?.value) as boolean | undefined;
const historyLength = useAppSelector((state) => state.properties.properties[LuaConsoleLengthKey]?.value) as number | undefined;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const consoleOpen = useAppSelector((state) => state.properties.properties[LuaConsoleIsVisibleKey]?.value) as boolean | undefined;
const historyLength = useAppSelector((state) => state.properties.properties[LuaConsoleLengthKey]?.value) as number | undefined;
const consoleOpen = usePropertyValue('BoolProperty', 'LuaConsole.IsVisible');
const historyLength = usePropertyValue('IntProperty', 'LuaConsole.HistoryLength');

Comment on lines +55 to +57

export const LuaConsoleIsVisibleKey = 'LuaConsole.IsVisible';
export const LuaConsoleLengthKey = 'LuaConsole.HistoryLength';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const LuaConsoleIsVisibleKey = 'LuaConsole.IsVisible';
export const LuaConsoleLengthKey = 'LuaConsole.HistoryLength';

I think we've decided to define these strings locally unless it its being used in multiple places and or is a more complex identifier. See suggestion below


import 'rc-dock/dist/rc-dock-dark.css';
import './WindowLayout.css';
import { LuaConsoleIsVisibleKey, LuaConsoleLengthKey } from '@/util/keys';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { LuaConsoleIsVisibleKey, LuaConsoleLengthKey } from '@/util/keys';

@@ -4,7 +4,7 @@ import DockLayout, { DockContext, LayoutData, PanelData, TabGroup } from 'rc-doc
import { FlightController } from '@/panels/FlightControlPanel/FlightController';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { FlightController } from '@/panels/FlightControlPanel/FlightController';
import { usePropertyValue } from '@/hooks/properties';
import { FlightController } from '@/panels/FlightControlPanel/FlightController';

@ylvaselling
Copy link
Copy Markdown
Collaborator

I know we talked about this but it looks a bit funky when you don't have any history.

image

@ylvaselling
Copy link
Copy Markdown
Collaborator

Looks good to me except when the history is not max. Also the code needs a npm run lint-fix

@ylvaselling
Copy link
Copy Markdown
Collaborator

I realized that we can scale the UI which makes this a bit tricky as it calculates pixels 🤔

@WeirdRubberDuck
Copy link
Copy Markdown
Collaborator

WeirdRubberDuck commented Mar 20, 2026

I realized that we can scale the UI which makes this a bit tricky as it calculates pixels 🤔

Yeah, this is problematic, and computing the diff in pixels this way seems pretty fragile. Also, for me, the offset is not correct even without any change to the scaling, unfortunately :/ Not sure why this is

image

There are also some other issues that emerged when testing this. For instance, changing the "History length" property affects the offset in an undesired way. Changing this makes it possible to accidentally completely hide the UI, which could be very confusing to our users. They would have to hide the Lua console to make the UI show again, which is not obvious (at least with these offset issues)
image

Also, the "Backspace character" and tabbing does not work correctly in the Web UI when the Lua console is open. So, you can't type in the text field in the UI or navigate properly when the Lua console is open. This is a bug (that should be fixed), but I think it might also be a reason to not encourage users to use the UI with the Lua console open, at least for now.

So, I would suggest that we close this for now, unfortunately, due to the issues above and the fragility of the solution. The idea is nice, and maybe we could reimplement it in the future, if we have fixed the issues with keyboard input capturing, and have a way of sending the relative size of the Lua console to the GUI or something. That way, we could avoid the issues of the miscomputed offset

@micahnyc
Copy link
Copy Markdown
Contributor Author

"we close this for now, unfortunately, due to the issues above and the fragility of the solution" agreed

@micahnyc
Copy link
Copy Markdown
Contributor Author

closing; see earlier comments

@micahnyc micahnyc closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants